package com.fzg.controller;


import com.fzg.common.enums.ResponseWrapper;
import com.fzg.common.model.personal.param.*;
import com.fzg.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fzg
 * @since 2022-03-26
 */
@RestController
@RequestMapping("/resume")
public class ResumeController {

    @Autowired
    private ResumeService resumeService;

    /**
     * 查询当前登陆的用户的简历信息
     * @param param
     * @return
     */
    @GetMapping("/queryLoginUserResume")
    public ResponseWrapper queryLoginUserResume(QueryLoginUserResume param){
        return resumeService.queryLoginUserResume(param);
    }

    /**
     * 保存简历
     * @param param
     * @return
     */
    @PostMapping("/saveResume")
    public ResponseWrapper saveResume(@RequestBody SaveResumeParam param){
        return resumeService.saveResume(param);
    }

    /**
     * 判断当前登录的用户是否有简历
     * @param param
     * @return
     */
    @GetMapping("/checkHaveResume")
    public ResponseWrapper checkHaveResume(CheckHaveResume param){
        return resumeService.checkHaveResume(param);
    }

    /**
     * 投递简历
     * @param param
     * @return
     */
    @PostMapping("/deliverResume")
    public ResponseWrapper deliverResume(@RequestBody DeliverResume param){
        return resumeService.deliverResume(param);
    }

    /**
     * 判断当前职位是否已经投递
     * @param param
     * @return
     */
    @GetMapping("/checkIsDeliver")
    public ResponseWrapper checkIsDeliver(DeliverResume param){
        return resumeService.checkIsDeliver(param);
    }

    /**
     * 判断当前登陆的用户是否有投递记录
     * @param param
     * @return
     */
    @GetMapping("/checkLoginUserIsHaveDeliverRecord")
    public ResponseWrapper checkLoginUserIsHaveDeliverRecord(CheckLoginUserIsHaveDeliverRecord param){
        return resumeService.checkLoginUserIsHaveDeliverRecord(param);
    }

    /**
     * 查询当前登录用户的投递记录
     * @param param
     * @return
     */
    @GetMapping("/queryLoginUserDeliverRecord")
    public ResponseWrapper queryLoginUserDeliverRecord(CheckLoginUserIsHaveDeliverRecord param){
        return resumeService.queryLoginUserDeliverRecord(param);
    }

    /**
     * 通过userJobAid查询用户的简历信息
     * @param param
     * @return
     */
    @GetMapping("/queryClickUserResume")
    public ResponseWrapper queryClickUserResume(QueryClickUserResume param){
        return resumeService.queryClickUserResume(param);
    }

}
